package com.xiaomo.gitee.datamanager.mapper;
import java.util.Collection;
import java.util.List;

import com.xiaomo.gitee.datamanager.cache.MybatisRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.xiaomo.gitee.datamanager.entity.ImageTag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@Mapper
@CacheNamespace(implementation = MybatisRedisCache.class,eviction = MybatisRedisCache.class)
public interface ImageTagMapper extends BaseMapper<ImageTag> {

    List<ImageTag> selectAllByImageId(@Param("imageId") String imageId);

    List<ImageTag> selectAllByTagId(@Param("tagId") Long tagId);

    int deleteByTagId(@Param("tagId") Long tagId);

    int deleteByImageId(@Param("imageId") String imageId);

    List<ImageTag> selectByImageIdAndTagId(@Param("imageId") String imageId, @Param("tagId") Long tagId);

    int deleteByImageIdAndIsBelongClassAndTagId(@Param("imageId") String imageId, @Param("isBelongClass") boolean isBelongClass, @Param("tagId") Long tagId);

    int deleteByImageIdAndTagId(@Param("imageId") String imageId, @Param("tagId") Long tagId);

    @Override
    int insert(ImageTag entity);

    int insertBatch(@Param("imageTagCollection") Collection<ImageTag> imageTagCollection);
}









